IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[cms_sp_WorkflowAdd]') AND type in (N'P', N'PC'))
	DROP PROCEDURE [dbo].[cms_sp_WorkflowAdd]
GO
create procedure [dbo].[cms_sp_WorkflowAdd]
@Id uniqueidentifier = null output,
@Cycle int,
@ApproveDateDeadline datetime,
@ReviewDateDeadline datetime,
@CreatedBy int,
@DateCreated datetime,
@LastUpdatedBy int = null,
@DateLastUpdated datetime = null
as
set @Id = newid()
insert into dbo.Workflows
(
WorkflowId,
Cycle,
ApproveDateDeadline,
ReviewDateDeadline,
CreatedBy,
DateCreated
)
values
(
@Id,
@Cycle,
@ApproveDateDeadline,
@ReviewDateDeadline,
@CreatedBy,
@DateCreated
)


GO

